<%--
  - Author		:	이 영호(Youngho Lee)	
  --%>
<%@ page language="java" %>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page pageEncoding="utf-8" %>
<%@ include file="/WEB-INF/pages/includes/taglibs.jspf" %>
<%@ include file="/WEB-INF/pages/includes/variables.jspf" %>
<%@ include file="/WEB-INF/pages/includes/doctype.jspf" %>
<html>
	<head>
<%@ include file="/WEB-INF/pages/includes/metatags.jspf" %>
		<title><fmt:message key="pages.title" /></title>
		<link rel="stylesheet" type="text/css" href="<c:url value="${dirStyles}/common.css" />" />

		<script type="text/javascript" src="<c:url value="${dirScripts}/jquery-1.7.2.min.js" />"></script>
		<script type="text/javascript">
			$(function(){
			});
			
			function goAction(idx){
				document.frm.idx.value=idx;
				document.frm.submit();
			}

			function goPage(page){
				document.searchFrm.page.value = page;
				document.searchFrm.submit();
			}

		</script>
	</head>
	<body>
<%@ include file="/WEB-INF/pages/includes/header.jsp" %>
		<div class="bodyWrap">
<%@ include file="/WEB-INF/pages/includes/left.jsp" %>
			<div class="contWrap">
				<div class="contMenuTitle">
					<img src="<c:url value="${dirImages}/subtit_03.gif" />" title="검증 결과 조회" alt="검증 결과 조회">
				</div>
				<div class="secTitle">
					<img src="<c:url value="${dirImages}/icon.png" />" title="검증결과" alt="검증결과" > 
					<c:choose>
						<c:when test="${param.type eq 'pay'}">
							결제기 검증
						</c:when>
						<c:otherwise>
							애플릿 검증
						</c:otherwise>
					</c:choose>
				</div>
				<table class="listTbl linked">
						<thead>
							<tr>
								<th>No.</th>
								<th>신청기관명</th>
								<th>검증단계</th>
								<th>검증 신청 일자</th>
								<th class="lastTh">완료 예정 일자</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${vertificationList}" var="vertification" varStatus="stat">
								<tr onclick="javascript:goAction(${vertification.idx});">
									<td>${vertificationListTotalCnt - stat.index - (maxnum*(page-1))}</td>
									<td>${vertification.bizName}</td>
									<td><%-- 검증 상태 (-1:오류, 0:검증 신청, 1:진행중, 2:성공) --%>
										<c:choose>
											<c:when test="${vertification.status eq -1}">검증 오류</c:when>
											<c:when test="${vertification.status eq 0}">검증 신청</c:when>
											<c:when test="${vertification.status eq 1}">검증 중</c:when>
											<c:when test="${vertification.status eq 2}">검증 완료</c:when>
											<c:otherwise>
												${vertification.status}
											</c:otherwise>
										</c:choose>
									</td>
									<td>
										<c:catch var="e">
											<fmt:parseDate var="createdTime" pattern="yyyy-MM-dd HH:mm:ss" value="${vertification.createdTime}" />
											<fmt:formatDate value="${createdTime}" pattern="yyyy/MM/dd" />
										</c:catch>
										<c:if test="${not empty e}">
											${vertification.createdTime}
										</c:if>
									</td>
									<td>
										<c:catch var="e">
											<fmt:parseDate var="completedTime" pattern="yyyy-MM-dd HH:mm:ss" value="${vertification.completedTime}" />
											<fmt:formatDate value="${completedTime}" pattern="yyyy/MM/dd" />
										</c:catch>
										<c:if test="${not empty e}">
											${vertification.completedTime}
										</c:if>
									</td>
								</tr>
							</c:forEach>
						</tbody>
						<c:if test="${vertificationListTotalCnt eq 0}">
							<tfoot>
								<tr>
									<td colspan="5">검증 신청 내용이 없습니다.</td>
								</tr>
							</tfoot>
						</c:if>
					</table>
					<c:if test="${vertificationListTotalCnt ne 0}">
						<div class="pagingWrap">
							<jsp:include page="/WEB-INF/pages/includes/paging.jsp">
								<jsp:param name="totalNum" value="${vertificationListTotalCnt}" />
								<jsp:param name="pageListCnt" value="${maxnum}" />
								<jsp:param name="pageGrpCnt" value="10" />
								<jsp:param name="pageIdx" value="${page}" />
							</jsp:include>
						</div>
					</c:if>
			</div>
		</div>
		<form name="frm" method="post" action="<c:url value="/result/detail.do" />">
			<input type="hidden" name="type" value="${param.type}" />
			<input type="hidden" name="idx" />
		</form>
		<form name="searchFrm" method="post" action="<c:url value="/result/listDetail.do" />">
			<input type="hidden" name="type" value="${param.type}" />
			<input type="hidden" name="maxnum" value="${maxnum}" />
			<input type="hidden" name="page" value="${page}" />
		</form>
<%@ include file="/WEB-INF/pages/includes/footer.jsp" %>
	</body>
</html> 